home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / vol6n21.arc / SUBPROG1.BAS < prev    next >
BASIC Source File  |  1987-11-17  |  2KB  |  51 lines

  1.  
  2. '-----------------------------------------------------------------------------
  3. ' File Name: SUBPROG1.BAS
  4. ' Routines : Find.monitor
  5.  
  6. ' Written  : 07/25/87 by Mark Novisoff
  7. ' Changes  : 07/29/87 by Mark Novisoff - added code to detect VGA
  8.  
  9. ' Comments : Requires EGAINFO.OBJ (source is EGAINFO.ASM)
  10.  
  11. '-----------------------------------------------------------------------------
  12. Sub Find.monitor (Monitor.segment%,Egamode%,Egacolumns%,Egarows%,Egastatus%,Egamem%) Static
  13.  
  14. ' Description - Determines if a monochrome or CGA adapter is active and
  15. ' if an EGA or VGA monitor is in the system.
  16. ' After calling this routine, check Egastatus% to determine if an EGA is
  17. ' present in the system. If so, the other variables are set as described
  18. ' below.
  19.  
  20. ' The following variables are available to the main program:
  21.  
  22. ' Monitor.segment% is &hb000 for monochrome or &hb800 for color.
  23. ' Egamode% is the current video mode
  24. ' Egacolumns% is the number of columns displayed on the screen (text modes)
  25. ' Egarows% is the number of rows displayed on the screen (text modes)
  26. ' Egastatus%: If -1, no EGA or VGA is present
  27. '             If  1, EGA is in monochrome mode
  28. '             If  0, EGA is in color mode
  29. '             If a VGA is present, 10 is added to Egastatus% of 0 and 1
  30. ' Egamem% is the amount of memory on the EGA adapter (in Kbytes)
  31. '-----------------------------------------------------------------------
  32. ' First we'll look at the BIOS equipment flag to determine if a CGA or
  33. ' monochrome adapter is active.
  34.  
  35.     Def Seg=&H40            ' BIOS data area
  36.     If (Peek(&H10) and &H30)=&h30 then
  37.           Monitor.segment%=&hb000
  38.     else
  39.       Monitor.segment%=&hb800
  40.     End if
  41.     Def Seg                ' back to BASIC's default segment        
  42.  
  43. '-----------------------------------------------------------------------
  44.  
  45. ' Call our assembly language subroutine - requires EGAINFO.OBJ
  46.  
  47.     Call Egainfo(Egamode%,Egacolumns%,Egarows%,Egastatus%,Egamem%)
  48.  
  49. End Sub
  50.  
  51.